<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./my-jQuery.js"></script>
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script> -->
    <script>
        // var cal = $.myCallbacks('stopOnFalse');
        // function a () {
        //     console.log('isa')
        //     return false
        // }
        // function b () {
        //     console.log('isb')
        // }
        // cal.add(a)
        // cal.add(a)
        // cal.add(b)


        // var cal = $.Callbacks('stopOnFalse');
        // cal.add(a)
        // cal.add(b)
        // cal.fire()
        // cal.fire()
        function creDef () {
            var def = $.MyDeferred();
            setTimeout(function() {
                def.resolve('bbbbb');
            }, 500);
            return def.promise();
        }
        // creDef()
        // console.log(creDef().then(function(a) {
        //     var def = $.MyDeferred();
        //     console.log(a)
        //     setTimeout(function() {
        //         def.resolve('aaaa');
        //     }, 500)
        //     return def.promise();
        // }))
        creDef().then(function(a) {
            var def = $.MyDeferred();
            console.log(a)
            setTimeout(function() {
                def.resolve('aaaa');
            }, 500)
            return def.promise();
        }).then(function(a) {
            console.log(a, 666)
        })
        // console.log(d)
        // function Abc() {
        //     if (Abc.cb) {
        //         console.log(1)
        //         return Abc.cb
        //     }
        //     console.log(2)
        //     Abc.cb = this
        // }
        // var dc = new Abc()
        // var a = new Abc()
        // var c = new Abc()
        // function test () {
        //     this.a = function() {
        //         new test()
        //     }
        // }

    </script>
</body>
</html>
